<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('功能设置')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-docset-edit" th:object="${sysSmtp}">
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">Access Key ID：</label>
                <div class="col-sm-8">
                    <input name="keyid" th:field="*{keyid}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">Access Key Secret：</label>
                <div class="col-sm-8">
                    <input name="keysecret" th:field="*{keysecret}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">注册短信签名：</label>
                <div class="col-sm-8">
                    <input name="signname1" th:field="*{signname1}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">注册短信模板：</label>
                <div class="col-sm-8">
                    <input name="template1" th:field="*{template1}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">找密短信签名：</label>
                <div class="col-sm-8">
                    <input name="signname2" th:field="*{signname2}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">找密短信模板：</label>
                <div class="col-sm-8">
                    <input name="template2" th:field="*{template2}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-offset-5 col-sm-10">
                <button type="button"  class="btn btn-sm btn-primary " onclick="submitHandler()"><i class="fa fa-check"></i>保存</button>&nbsp;
            </div>
        </div>
        <div class="row">

        </div>

    </form>
    <div class="row" style="position: relative">
        <div class="col-xs-12" style="position: absolute;left: 30%">
            <h4>要使用短信服务，用户发送注册验证码或找密验证码，需要开通阿里云短信服务：</h4>
            <br>
            <p>1.阿里云短信服务开通地址：<a target="_blank" href='https://www.aliyun.com/product/sms'>https://www.aliyun.com/product/sms</a></p><br>
            <p>2.其中短信模板需要包含一个${code}参数。</p><br>
            <p>3.短信模板举例：您的验证码为：${code}，该验证码 5 分钟内有效，请勿泄漏于他人。</p><br>
        </div>
    </div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
    var prefix = ctx + "system/smsset";
    $("#form-docset-edit").validate({
        focusCleanup: true
    });
    function submitHandler() {
        if ($.validate.form()) {
            var data = $('#form-docset-edit').serializeArray();
            $.operate.save(prefix + "/edit", data,function(result) {
                layer.msg(result.msg, {
                    icon: $.modal.icon(0),
                    time: 500,
                    shade: [0.1, '#8F8F8F']
                });
            });
        }
    }
</script>
</body>
</html>